//
//  UPReportDataManager.m
//  Uang Pasti
//
//  Created by 李永彬 on 2025/8/28.
//

#import "UPReportDataManager.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>

@implementation UPReportDataManager

+ (void)reportLocationInfoWithLocationInfo: (UPLocationInfo)locationInfo {
    [UPStocksAPIManager reportLocationInfoWithLocationInfo:locationInfo completion:^(BOOL success) {
        
    }];
}

+ (void)reportDeviceInfo {
    [UPStocksAPIManager reportDeviceInfoWithCompletion:^(BOOL success) {
        
    }];
}

+ (void)reportToGoogleMarket {
    [UPStocksAPIManager reportToGoogleMarketWithCompletion:^(GoogleMarketModel * _Nonnull model, NSString * _Nonnull msg) {
        if (model) {
            FBSDKSettings.sharedSettings.appID = model.mattereous.hitture;
            FBSDKSettings.sharedSettings.clientToken = model.mattereous.kakling;
            FBSDKSettings.sharedSettings.displayName = model.mattereous.gaslet;
            FBSDKSettings.sharedSettings.appURLSchemeSuffix = model.mattereous.listenness;
            [[FBSDKApplicationDelegate sharedInstance] application:[UIApplication sharedApplication] didFinishLaunchingWithOptions:nil];
        }
    }];
}

+ (void)reportToMaiDian:(UPSceneType)sceneType
              productId: (NSString *)productId
             productNum: (NSString *)productNum
         startTimeStamp: (double)startTimeStamp
           endTimeStamp: (double)endTimeStamp {
    if ([AppConfig sharedInstance].appCountryEnv == AppCountryEnvIndia) {
        return;
    }
    [[UPLocationManager sharedManager] upRequestLocationPermissionWithCompletion:^(BOOL granted) {
            
    }];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [UPStocksAPIManager reportToMaiDian:sceneType
                                  productId:productId
                                 productNum:productNum
                             startTimeStamp:(NSInteger)startTimeStamp
                               endTimeStamp:(NSInteger)endTimeStamp
                                 completion:^(BOOL success) {
            
        }];
    });
}

+ (void)reportContacts:(NSString *)contactsString {
    [UPStocksAPIManager reportContacts:contactsString completion:^(BOOL success) {
        
    }];
}
@end
